import java.util.Scanner;
public class Example3_2 {
    public static void main(String[] args){
        Scanner reader = new Scanner(System.in);
        System.out.println("*********************************");
        System.out.println("*****微型计算器               ****");
        System.out.println("*****1、求和                 ****");
        System.out.println("*****2、求差                 ****");
        System.out.println("*****3、求积                 ****");
        System.out.println("*****4、求商                 ****");
        System.out.println("*****5、求余                 ****");
        System.out.println("*****Q、退出                 ****");
        System.out.println("*****请选择您想执行的操作       ****");
        System.out.println("*********************************");
        String num = reader.next();
        if(num.equals("Q")){
            System.out.println("程序结束");
        }
        else{
            System.out.println("请输入两个数：");
            double a = reader.nextDouble();
            double b = reader.nextDouble();
            switch(num) {
                case "1":
                    System.out.printf("%.2f", a + b);
                    break;
                case "2":
                    System.out.printf("%.2f", a - b);
                    break;
                case "3":
                    System.out.printf("%.2f", a * b);
                    break;
                case "4":
                    System.out.printf("%.2f", a / b);
                    break;
                case "5":
                    System.out.printf("%.2f", a % b);
                    break;
            }
        }

    }
}